package com.fujimana.android.manacode.converter.token;

import com.fujimana.android.manacode.converter.Decorator;
import com.fujimana.android.manacode.converter.Options;
import com.fujimana.android.manacode.converter.Token;
import com.fujimana.android.manacode.utils.Utils;

public class LinenoToken extends Token {
	
	public static final String TYPE = LinenoToken.class.getName();
	
	public static final Decorator DECORATE = new LinenoDecorator();
	
	public LinenoToken(int no, Options options) {
		super("", options);
		
		if(options.isLineno()) {
			setValue(Utils.padding(4, no, '0')+ ": ");
		}
	}

	@Override
	public String getFormatedValue() {
		return getValue();
	}

	static class LinenoDecorator implements Decorator {

		@Override
		public String decorate() {
			return "color: #808080";
		}

		@Override
		public boolean isDecorate(String value) {
			return true;
		}
		
	}
}
